#!/bin/bash

# Input parameters: Image file name (any type, png, gif, jpg...)
# Example:
#
# ./plot.sh kapmap.gif

gridhi=$1

echo "
set xlabel 'arcsec'
set xrange [-$gridhi:$gridhi]
set yrange [-$gridhi:$gridhi]

plot  'grid.dat' with lines lc rgb 'gray'  t 'grid', 'cc.dat' w l lc rgb 'red' t 'Criticas'

plot  'grid.dat' using 3:4 with lines lc rgb 'gray'  t 'grid', 'cc.dat' using 3:4 w l lc rgb 'red' t 'Criticas'

set terminal png font '/usr/share/fonts/truetype/freefont/FreeSans.ttf' 13 size 525,500
set output 'nfw.png'
replot

" | gnuplot -persist

if [ $# > 0 ]; then

    #   montage nfw.png <put other file name here>  -geometry '400x400+2+2>' $1

fi

